Optimal. Leaf size=78 \[ \frac {2 \cot (c+d x)}{a^2 d}+\frac {2 \cos (c+d x)}{a^2 d (\sin (c+d x)+1)}-\frac {5 \tanh ^{-1}(\cos (c+d x))}{2 a^2 d}-\frac {\cot (c+d x) \csc (c+d x)}{2 a^2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.22, antiderivative size = 78, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 7, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.259, Rules used = {2874, 2966, 3770, 3767, 8, 3768, 2648} \[ \frac {2 \cot (c+d x)}{a^2 d}+\frac {2 \cos (c+d x)}{a^2 d (\sin (c+d x)+1)}-\frac {5 \tanh ^{-1}(\cos (c+d x))}{2 a^2 d}-\frac {\cot (c+d x) \csc (c+d x)}{2 a^2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2648
Rule 2874
Rule 2966
Rule 3767
Rule 3768
Rule 3770
Rubi steps
\begin {align*} \int \frac {\cot ^2(c+d x) \csc (c+d x)}{(a+a \sin (c+d x))^2} \, dx &=\frac {\int \frac {\csc ^3(c+d x) (a-a \sin (c+d x))}{a+a \sin (c+d x)} \, dx}{a^2}\\ &=\frac {\int \left (2 \csc (c+d x)-2 \csc ^2(c+d x)+\csc ^3(c+d x)-\frac {2}{1+\sin (c+d x)}\right ) \, dx}{a^2}\\ &=\frac {\int \csc ^3(c+d x) \, dx}{a^2}+\frac {2 \int \csc (c+d x) \, dx}{a^2}-\frac {2 \int \csc ^2(c+d x) \, dx}{a^2}-\frac {2 \int \frac {1}{1+\sin (c+d x)} \, dx}{a^2}\\ &=-\frac {2 \tanh ^{-1}(\cos (c+d x))}{a^2 d}-\frac {\cot (c+d x) \csc (c+d x)}{2 a^2 d}+\frac {2 \cos (c+d x)}{a^2 d (1+\sin (c+d x))}+\frac {\int \csc (c+d x) \, dx}{2 a^2}+\frac {2 \operatorname {Subst}(\int 1 \, dx,x,\cot (c+d x))}{a^2 d}\\ &=-\frac {5 \tanh ^{-1}(\cos (c+d x))}{2 a^2 d}+\frac {2 \cot (c+d x)}{a^2 d}-\frac {\cot (c+d x) \csc (c+d x)}{2 a^2 d}+\frac {2 \cos (c+d x)}{a^2 d (1+\sin (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 0.78, size = 364, normalized size = 4.67 \[ -\frac {4 \sin \left (\frac {1}{2} (c+d x)\right ) \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )^3}{d (a \sin (c+d x)+a)^2}-\frac {5 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right ) \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )^4}{2 d (a \sin (c+d x)+a)^2}+\frac {5 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right ) \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )^4}{2 d (a \sin (c+d x)+a)^2}-\frac {\tan \left (\frac {1}{2} (c+d x)\right ) \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )^4}{d (a \sin (c+d x)+a)^2}+\frac {\cot \left (\frac {1}{2} (c+d x)\right ) \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )^4}{d (a \sin (c+d x)+a)^2}-\frac {\csc ^2\left (\frac {1}{2} (c+d x)\right ) \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )^4}{8 d (a \sin (c+d x)+a)^2}+\frac {\sec ^2\left (\frac {1}{2} (c+d x)\right ) \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )^4}{8 d (a \sin (c+d x)+a)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.50, size = 246, normalized size = 3.15 \[ \frac {16 \, \cos \left (d x + c\right )^{3} + 10 \, \cos \left (d x + c\right )^{2} - 5 \, {\left (\cos \left (d x + c\right )^{3} + \cos \left (d x + c\right )^{2} + {\left (\cos \left (d x + c\right )^{2} - 1\right )} \sin \left (d x + c\right ) - \cos \left (d x + c\right ) - 1\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 5 \, {\left (\cos \left (d x + c\right )^{3} + \cos \left (d x + c\right )^{2} + {\left (\cos \left (d x + c\right )^{2} - 1\right )} \sin \left (d x + c\right ) - \cos \left (d x + c\right ) - 1\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - 2 \, {\left (8 \, \cos \left (d x + c\right )^{2} + 3 \, \cos \left (d x + c\right ) - 4\right )} \sin \left (d x + c\right ) - 14 \, \cos \left (d x + c\right ) - 8}{4 \, {\left (a^{2} d \cos \left (d x + c\right )^{3} + a^{2} d \cos \left (d x + c\right )^{2} - a^{2} d \cos \left (d x + c\right ) - a^{2} d + {\left (a^{2} d \cos \left (d x + c\right )^{2} - a^{2} d\right )} \sin \left (d x + c\right )\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.19, size = 116, normalized size = 1.49 \[ \frac {\frac {20 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{a^{2}} + \frac {a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 8 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{4}} + \frac {32}{a^{2} {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}} - \frac {30 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 8 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1}{a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2}}}{8 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.76, size = 114, normalized size = 1.46 \[ \frac {\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}{8 d \,a^{2}}-\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d \,a^{2}}-\frac {1}{8 d \,a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}+\frac {1}{d \,a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}+\frac {5 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d \,a^{2}}+\frac {4}{d \,a^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.34, size = 161, normalized size = 2.06 \[ \frac {\frac {\frac {7 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {40 \, \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - 1}{\frac {a^{2} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {a^{2} \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}} - \frac {\frac {8 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {\sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}}{a^{2}} + \frac {20 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}}}{8 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 8.66, size = 120, normalized size = 1.54 \[ \frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,a^2\,d}+\frac {5\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{2\,a^2\,d}+\frac {20\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+\frac {7\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2}-\frac {1}{2}}{d\,\left (4\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+4\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a^2\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \frac {\int \frac {\cos ^{2}{\left (c + d x \right )} \csc ^{3}{\left (c + d x \right )}}{\sin ^{2}{\left (c + d x \right )} + 2 \sin {\left (c + d x \right )} + 1}\, dx}{a^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________